﻿using System;
using System.Web.Mvc;

namespace WebUI.Helpers
{
    public static class ActionHelper
    {
        public static string GetMenuClass(this HtmlHelper helper, string actionName, string controllerName)
        {
            var currentControllerName = (string)helper.ViewContext.RouteData.Values["controller"];
            var currentActionName = (string)helper.ViewContext.RouteData.Values["action"];

            if (currentControllerName.Equals(controllerName, StringComparison.CurrentCultureIgnoreCase))
            {
                return "current-menu-item";
            }        
            else
            {
                return "";
            }
        }
    }
}